package com.ruoyi.college.controller;

import com.ruoyi.college.domain.vo.SubjectTreeVo;
import com.ruoyi.college.service.ISubjectTreeService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/college/subjectTree")
public class SubjectTreeController extends BaseController {
    @Autowired
    private ISubjectTreeService subjectTreeService;

    @GetMapping("/getTree")
    public AjaxResult getSubjectTree() {
        List<SubjectTreeVo> tree = subjectTreeService.getSubjectTree();
        return AjaxResult.success(tree);
    }
}
